/**
 * Copyright (c) 2009 Cerner Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Cerner Corporation - initial API and implementation
 */
package com.cerner.system.rest.resource.organizer.spi;

/**
 * SPI to represent the state of a node in a hierarchical tree structure.
 * 
 * @author Alex Horn
 * @param <E> class type of the object that is stored in the tree data structure
 */
public interface ResourceRef<E> {

  /**
   * Obtain the reference to the data object that is associated with this tree
   * node.
   * 
   * @return reference to resource representation
   */
  public E get();

  /**
   * Store a reference to the resource representation.
   * 
   * @param representation non-{@code null} resource representation
   * @return previous representation, or {@code null} if there was no existing
   *         resource representation
   */
  public E set(E representation);
}
